package projetolp2.GraphicInterface;


import javax.swing.*;

import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;


@SuppressWarnings("serial")
public class SugestoesPersonalizadaPrato extends MealPoints implements ActionListener{
	
	private JPanel panelMenu = new JPanel(new BorderLayout());
	private JButton ALACARTE = new JButton(NomeBotoes.values()[idioma(IDIOMAPROGRAMA )].getALaCarte());
	private JButton SELFSERVICE = new JButton(NomeBotoes.values()[idioma(IDIOMAPROGRAMA )].getSelfService());
	private JButton PRATOFEITO = new JButton(NomeBotoes.values()[idioma(IDIOMAPROGRAMA )].getPratoFeito());
	private JButton VOLTAR = new JButton(NomeBotoes.values()[idioma(IDIOMAPROGRAMA )].getVoltar());
	final JLabel label = new JLabel("Escolha o tipo de atendimento de sua preferencia: ");
	private JPanel panelFinal = new JPanel();

	private JPanel panel1 = new JPanel(new GridLayout(0, 1));
	private JPanel panel2= new JPanel(new GridLayout(0, 1));
	private JPanel panel3= new JPanel(new GridLayout(0, 1));
	private JPanel panel4= new JPanel(new GridLayout(0, 1));
	
	public SugestoesPersonalizadaPrato(){
		
	}private void ajudaDeBotoes(){
		ALACARTE.setToolTipText("O gar�on le serve na mesa");
		SELFSERVICE.setToolTipText("Voc� faz o seu prato");
		PRATOFEITO.setToolTipText("O gar�on le entrega o prato feito");
		VOLTAR.setToolTipText("Voltar a janela anterior");
	}
	
	@SuppressWarnings("deprecation")
	public void actionPerformed(ActionEvent e){
		if(e.getSource() == ALACARTE){
			janela.disable();
			quantidadeSugestoes.abilitaDesabilita(true, "ALC");
		}
		else if(e.getSource() == SELFSERVICE){
			janela.disable();
			quantidadeSugestoes.abilitaDesabilita(true, "SS");
		}
		else if(e.getSource() == PRATOFEITO){
			janela.disable();
			quantidadeSugestoes.abilitaDesabilita(true, "PF");
		}
		else if(e.getSource() == VOLTAR){
			removerAdicionar(sugestoespersonalizadasPrato,sugestoespersonalizadas );
			
		}
	}
	private void createComponents() {
		ajudaDeBotoes();
		
		ALACARTE.setMnemonic(KeyEvent.VK_I);
		ALACARTE.addActionListener(this);
        label.setLabelFor(ALACARTE);
        
        SELFSERVICE.setMnemonic(KeyEvent.VK_I);
        SELFSERVICE.addActionListener(this);
        label.setLabelFor(SELFSERVICE);
        
        PRATOFEITO.setMnemonic(KeyEvent.VK_I);
        PRATOFEITO.addActionListener(this);
        label.setLabelFor(PRATOFEITO);
        
        VOLTAR.setMnemonic(KeyEvent.VK_I);
        VOLTAR.addActionListener(this);
        label.setLabelFor(VOLTAR);
        
        panel1.add(ALACARTE);
        panel2.add(SELFSERVICE);
        panel3.add(PRATOFEITO);
        panel4.add(VOLTAR);
        panel1.setBorder(BorderFactory.createEmptyBorder(
                5, //top
                10, //left
                5, //bottom
                10) //right
                );
        panel2.setBorder(BorderFactory.createEmptyBorder(
                5, //top
                10, //left
                5, //bottom
                10) //right
                );
        panel3.setBorder(BorderFactory.createEmptyBorder(
                5, //top
                10, //left
                5, //bottom
                10) //right
                );
        panel4.setBorder(BorderFactory.createEmptyBorder(
                5, //top
                10, //left
                5, //bottom
                10) //right
                );
        
        panelFinal.add(panel1);
        panelFinal.add(panel2);
        panelFinal.add(panel3);
        panelFinal.add(panel4);
        panelMenu.add(panelFinal,BorderLayout.NORTH);
    }
	public Component panel(){
		createComponents();
		panelMenu.setVisible(true);
		
		
		return panelMenu;
	}	
}

